﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using MahApps.Metro.Controls;

namespace LunarSF.SHomeWorkshop.LunarMarkdownEditor
{
    /// <summary>
    /// MultiInputBox.xaml 的交互逻辑
    /// </summary>
    public partial class WrapTextSetter : MetroWindow
    {
        public WrapTextSetter()
        {
            InitializeComponent();
        }

        private void btnReset_Click(object sender, RoutedEventArgs e)
        {
            tbxFst.Text = "`";
            tbxSec.Text = "";
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
        {
            tbxFst.Focus();
        }

        private void tbxFst_GotFocus(object sender, RoutedEventArgs e)
        {
            tbxFst.SelectAll();
        }

        private void tbxSec_GotFocus(object sender, RoutedEventArgs e)
        {
            tbxSec.SelectAll();
        }

        private void Hyperlink_Click(object sender, RoutedEventArgs e)
        {
            LMessageBox.ShowInfomation(
                "所谓“弹性封装”是自动尝试按类别将当前插入点位置处的同类字符选中并用一对反引号进行封装。这些类别包括：\r\n" +
                "　　　1. 字母和数字\r\n" +
                "　　　2. 汉字\r\n" +
                "注意：1. 当插入点光标位于两类字符中间时，字母数字优先；\r\n" +
                "　　　2. 半角的空格和“+-_=[]{};:'\",.<>/?~!@#$%^&*()”等标点字符也算第 1 类。");
        }
    }
}
